package com.fengjue.mapper;

import com.fengjue.pojo.Admin;
import com.fengjue.pojo.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author fengjue
 * @since 2021-03-10
 */
public interface RoleMapper extends BaseMapper<Role> {

    /**
     * 根据用户id查询角色列表
     * @param adminId
     * @return
     */
//    @Select("<script>  select r.id,r.name,r.nameZh\n" +
//            "        from t_role r,t_admin_role ar\n" +
//            "        where r.id = ar.rid and ar.adminId = #{adminId};</script>")
    List<Role> getRoles(@Param("adminId") Integer adminId);

    List<Role> getRoles2(@Param("adminId") Integer adminId);
}
